/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ejb.dao;

import entidades.Paises;
import java.util.ArrayList;
import javax.ejb.Stateless;
import javax.persistence.Query;

/**
 *
 * @author Pablo
 */
@Stateless
public class PaisDAO extends GenericoDAOJPA<Paises> implements PaisDAOLocal {

    @Override
    public String getPaisName(Integer idPais) {
        Paises p = buscarPorId(idPais);
        return p.getPais();
    }

    @Override
    public ArrayList<Paises> getListaPaises() {
        Query q = em.createQuery("SELECT p FROM Paises p");
        return new ArrayList(q.getResultList());
    }

    @Override
    public Paises getPais(Integer idPais) {
        return buscarPorId(idPais);
    }
}
